import request from "@/utils/request";
import type { Question } from "@/types/question";
import type { ConversationDTO, ConversationListResponse } from "./history";

// 楼层导览响应类型
interface FloorGuideResponse {
  floor_guide_image: string;
  message: string;
}

// 问题列表响应类型
interface QuestionListResponse {
  total: number;
  questions: Question[];
}

// 获取楼层导览图片URL（无需认证）
export const getFloorGuideImage = (): Promise<FloorGuideResponse> => {
  return request.get("/external/floor-guide");
};

// 获取开放状态的问题列表（无需认证）
export const getActiveQuestions = (): Promise<QuestionListResponse> => {
  return request.get("/external/questions");
};

// 获取外部系统的历史记录（无需认证）
export const getExternalConversations = (): Promise<ConversationListResponse> => {
  return request.get("/external/conversations");
};

// 获取外部系统对话详情（无需认证）
export const getExternalConversationDetail = (
  conversationId: number
): Promise<ConversationDTO> => {
  return request.get(`/external/conversations/${conversationId}`);
};
